file_name = 'word.txt'

word_count = 0
character_count = 0
with open(file_name, 'r', encoding='utf-8') as f:
    for line in f:
        word = line.split()
        word_count += len(word)
        character_count += len(line)
print('单词数：', word_count)
print('字母数：', character_count)
